Skip to content

feat(mcpgrade): grade an MCP server against the spec essentials - #15

Merged
perkinsjr merged 5 commits into
mainfrom
perkinsjr/mcp-checking
Nov 28, 2026
Merged

perkinsjr merged 5 commits into
mainfrom
perkinsjr/mcp-checking

Conversation

@perkinsjr

Copy link
Copy Markdown
Member

Why

We want Byname to grade an entity's own MCP server, the way manufact.com's MCP leaderboard does, but checked against the MCP spec itself. This PR adds the grader. Nothing in the app calls it yet.

You give it a URL and, if the server needs one, a token. It gives back a score from 0 to 100, a letter, six category scores, and one result per check. Each check that does not pass says what it saw and how to fix it.

What changed

  • New package internal/mcpgrade with one function, Grade.
  • 41 checks in six groups: Connection, Authorization, Server metadata, Tool definitions, Tool documentation, Discoverability. They cover the spec's must-haves, such as a 400 for an unknown protocol version, -32601 for an unknown method, refusing foreign origins, OAuth discovery, and PKCE with S256.
  • All checks live in one table. Scoring is a pure function, so tests build what a server returned by hand.

Scope

  • It only reads metadata. It never calls a tool on the server.
  • Storage, routes, MCP tools and the settings page come in the next PR. The paid AI review of tool docs comes after that.
  • It does not check the Claude, ChatGPT or Cursor directories, because they have no public way to confirm a listing. It checks the official MCP Registry instead. A server listed under a GitHub-style name (io.github.*) can be missed.

Tradeoffs

  • Tools are read from the server's raw response, not from the Go SDK. The SDK drops tools it thinks are invalid, and it reads a missing readOnlyHint as false. Both would hide exactly what we want to grade.
  • Response time is shown but not scored, so grading the same server twice gives the same grade.
  • If a server needs sign-in and no token is given, the three tool groups count as 0. Manufact does the same. The next PR labels this a partial grade on the page.

Blast Radius

New package only. Nothing imports it yet. Every request goes through one transport. It sends the token only to the MCP URL, stops after 40 requests or 8 MiB, and stops at 30 seconds. It uses the same client that blocks private addresses as the rest of Byname.

Verification

  • go test -race ./internal/mcpgrade/ passes. A real Go SDK server grades 100 A+. A fake server with faults loses points on exactly the checks it breaks.
  • Graded three live servers: DeepWiki got 63 C, Cloudflare docs got 66 C, and Manufact got 45 D (sign-in only, no token). I checked each failing result against the server with curl.

…s, a 0 to 100 score and a letter

The catalog is one table of checks, each a server-level or per-tool judge, and scoring is pure, so every rule is tested on literal observations. The probe that fills an observation comes next.
…alling a tool

Grade takes a URL and an optional token, runs every request through a wire that sends the token only to the endpoint, caps each answer at 2 MiB and the grade at 40 requests and 8 MiB, and keeps tools/list as the server sent it, so tools the go-sdk would drop are still graded. The origin check now compares against the same request without the Origin, so a 400 for another reason no longer passes it.
…th faults

A well-documented go-sdk server grades 100. The fake's knobs grade down the checks they break: missing hints, a tool the go-sdk drops, bad names, sign-in with and without S256, no 400 on an unknown protocol version, the registry listed, unlisted and down, an endless tools/list, and the token reaching nothing but the endpoint.

@perkinsjr perkinsjr left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few inline notes on the credential scoping and the schema and tool checks.

Comment thread internal/mcpgrade/wire.go Resolved
Comment thread internal/mcpgrade/checks.go Resolved
Comment thread internal/mcpgrade/checks.go Resolved
…artial, and fail malformed input schema properties
@perkinsjr
perkinsjr added this pull request to stack #18 November 28, 2026 17:58
@perkinsjr
perkinsjr enabled stacked auto-merge November 28, 2026 17:58
stacked auto-merge was automatically disabled November 28, 2026 17:59

Auto-merge was disabled for another pull request in the stack

@perkinsjr
perkinsjr merged commit a461940 into main Nov 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant